<%@page contentType="text/html; charset=UTF-8"%>
<%@taglib uri="/WEB-INF/struts-tags.tld" prefix="s"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>外卖管理系统</title>
<link rel="stylesheet" href="/css/admin.css" type="text/css"/>
<link rel="stylesheet" href="/css/redmond.datepick.css" type="text/css" />
<script type="text/javascript" src="/js/jquery-1.6.1.min.js"></script>
<script type="text/javascript" src="/js/jquery.datepick.min.js"></script>
<script type="text/javascript" src="/js/jquery.datepick-zh-CN.js"></script>
<script type="text/javascript" src="/js/popup.js"></script>
<script type="text/javascript">
$(document).ready(function(){
	$("#showTime").datepick();
});
</script>
</head>
<body leftmargin="2" topmargin="2">
<s:form id="create" action="admin_restaurant" onsubmit="VF_restaurantflag();return false;">
<s:hidden name="action" />
<s:hidden name="id" />
 <fieldset><legend>
 <s:if test="%{action=='doadd'}">添加饭店方式</s:if>
 <s:if test="%{action=='doupdate'}">修改饭店方式</s:if>
 </legend>
 <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">
  <COLGROUP>
  <COL width="100" />
  <COL width="*" />
    <tr class="tdbg2"> 
      <td align="right" >饭店名称：</td>
      <td><s:textfield id="resName" name="resName" size="20"/><a href="javascript:getApplyRestaurant()">查询申请饭店</a></td>
    </tr>
    <tr class="tdbg3"> 
      <td align="right">Logo：</td>
      <td>
      <s:textfield id="logo" name="logo" size="20"/><input type="button" name="bigImgSubmit" value="上传图片" onclick="window.open('admin_upload_pic.action?editId=logo','','status=no,scrollbars=no,top=20,left=110,width=420,height=165')" />
      <br />
       <s:if test="%{action=='doupdate'}">
      <img src="<s:property value="logoPath"/>" border="0" />
      </s:if>
      </td>
    </tr>
    <tr class="tdbg3"> 
      <td align="right">首 字 母：</td>
      <td><s:textfield id="resInitials" name="resInitials" size="20"/></td>
    </tr>
    <tr class="tdbg3"> 
      <td align="right">电话：</td>
      <td><s:textfield id="phone" name="phone" size="20"/></td>
    </tr>
    <tr class="tdbg3"> 
      <td align="right">电话2：</td>
      <td><s:textfield id="phone2" name="phone2" size="20"/></td>
    </tr>
    <!-- 
    <tr class="tdbg2"> 
      <td align="right">简  拼：</td>
      <td><s:textfield id="resAnglic" name="resAnglic" size="20"/></td>
    </tr>
    <tr class="tdbg3"> 
      <td align="right">全  拼：</td>
      <td><s:textfield id="resPhonetic" name="resPhonetic" size="20"/></td>
    </tr>
     -->
    <tr class="tdbg3"> 
      <td align="right">口   味：</td>
      <td><s:textfield id="resTaste" name="resTaste" size="20"/></td>
    </tr>
    <tr class="tdbg3"> 
      <td align="right">连   锁：</td>
      <td><s:select list="catenationList" name="isCatenation" id="isCatenation" listKey="key" listValue="value"></s:select></td>
    </tr>
    <tr class="tdbg3"> 
      <td align="right">起送价：</td>
      <td><s:textfield id="deliveryPrice" name="deliveryPrice" size="20"/></td>
    </tr>
    <tr class="tdbg3"> 
      <td align="right">特殊说明：</td>
      <td><s:textfield id="specialMemo" name="specialMemo" size="20"/></td>
    </tr>
    <tr class="tdbg3"> 
      <td align="right">饭店简介：</td>
      <td><s:textfield id="summary" name="summary" size="20"/></td>
    </tr>
    <tr class="tdbg3"> 
      <td align="right">地址：</td>
      <td><s:textfield id="address" name="address" size="20"/></td>
    </tr>
    <tr class="tdbg3"> 
      <td align="right">距离：</td>
      <td><s:textfield id="distance" name="distance" size="20"/></td>
    </tr>
    <tr class="tdbg3"> 
      <td align="right">饭店公告：</td>
      <td><s:textfield id="notice" name="notice" size="20"/></td>
    </tr>
    <tr class="tdbg3"> 
      <td align="right">促销信息：</td>
      <td><s:textfield id="salesPromotion" name="salesPromotion" size="20"/></td>
    </tr>
    
    <tr class="tdbg3"> 
      <td align="right">是否有效：</td>
      <td><s:select list="validList" name="valid" id="valid" listKey="key" listValue="value"></s:select></td>
    </tr>
    <tr class="tdbg3"> 
      <td align="right">是否显示：</td>
      <td><s:select list="isShowList" name="isShow" id="isShow" listKey="key" listValue="value"></s:select></td>
    </tr>
    <tr class="tdbg3"> 
      <td align="right">显示时间：</td>
      <td><s:textfield id="showTime" name="showTime" size="20"><s:param name="value"><s:date name="showTime" format="yyyy-MM-dd" /></s:param></s:textfield></td>
    </tr>
	<tr class="tdbg3"> 
      <td align="right">排  序：</td>
      <td><s:textfield id="orderNum" name="orderNum" size="20"/></td>
    </tr>
     <tr class="tdbg3">
      <td colspan="2" align="center"><s:submit value="提交"/></td>
    </tr>
</table></fieldset>
</s:form>
<script type="text/javascript">
function VF_restaurantflag(){ 
    var errMsg = "";
    if(isNaN($('#orderNum').val())){
		errMsg = "排序请添写数字！";
	}
	if ($('#isShow').val() == -1){
        errMsg = "请选择显示信息！";
    }
    if ($('#valid').val() == -1){
        errMsg = "请选择是否有效！";
    }
    if(isNaN($('#deliveryPrice').val())){
		errMsg = "起送价请添写数字！";
	}
	if(isNaN($('#distance').val())){
		errMsg = "距离请添写数字！";
	}
    if ($('#isCatenation').val() == -1){
        errMsg = "请选择连锁！";
    }
    if ($('#tasteList').val() == -1){
        errMsg = "请选择口味！";
    }
    if ($('#resPhonetic').val() == ""){
        errMsg = "请填写全拼！";
    }
    if ($('#resAnglic').val() == ""){
        errMsg = "请填写简拼！";
    }
	if ($('#resInitials').val() == ""){
        errMsg = "请填写首字母！";
    }
    if ($('#resName').val() == ""){
        errMsg = "请填写名称！";
    }
    if (errMsg != ""){
        alert(errMsg);
    }else{
		document.getElementById('create').submit();
	}
}
function getApplyRestaurant(){ 
		openshow('/admin_apply_restaurant.action?action=pop','申请饭店信息',false,700,310,1);
}
function resSelect(resName,phone,phone2){
	$('#resName').val(resName);
	$('#phone').val(phone);
	$('#phone2').val(phone2);
}
</script>
</body>
</html>
